cmake_minimum_required(VERSION 3.16)

project(Kontrast VERSION 0.1 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt6 REQUIRED COMPONENTS Quick Widgets)

qt_standard_project_setup(REQUIRES 6.5)

qt_add_executable(appKontrast
    main.cpp
)

qt_add_qml_module(appKontrast
    URI Kontrast
    VERSION 1.0
    QML_FILES
        Main.qml
        RESOURCES
        RESOURCES icons/actions/open-menu-symbolic.png
        RESOURCES icons/actions/favorite-symbolic.png icons/actions/help-about-symbolic.png icons/actions/help-contents-symbolic.png icons/actions/user-home-symbolic.png
        QML_FILES
        QML_FILES
        QML_FILES MainPage.qml
        QML_FILES AboutPage.qml
        RESOURCES icons/actions/color-picker-symbolic.png icons/actions/randomize-symbolic.png icons/actions/reverse-symbolic.png
        QML_FILES MySlider.qml
        QML_FILES HelpPage.qml
        SOURCES kontrast.h kontrast.cpp
        QML_FILES Utilities.js
        QML_FILES FavoritePage.qml
        RESOURCES icons/actions/dialog-ok-apply-symbolic.png icons/actions/edit-copy-symbolic.png icons/actions/edit-delete-remove-symbolic.png
)

# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
# If you are developing for iOS or macOS you should consider setting an
# explicit, fixed bundle identifier manually though.
set_target_properties(appKontrast PROPERTIES
#    MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appKontrast
    MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
    MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
    MACOSX_BUNDLE TRUE
    WIN32_EXECUTABLE TRUE
)

target_link_libraries(appKontrast
    PRIVATE Qt6::Quick
    Qt6::Widgets
)

include(GNUInstallDirs)
install(TARGETS appKontrast
    BUNDLE DESTINATION .
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
